#include <stdio.h>
#include <math.h>

typedef struct Point Point;
struct Point {
  float x, y;
};

float distance1(Point  p1, Point  p2) {
    int x1 = p1.x;
    int y1 = p1.y;
    int x2 = p2.x;
    int y2 = p2.y;
    float d = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
    return d;
}

float distance2(Point *p1, Point *p2) {
    int x1 = (*p1).x;
    int y1 = (*p1).y;
    int x2 = p2->x;
    int y2 = p2->y;
    float d = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
    return d;
}

int main() {
    Point p1 = {0, 0};
    Point p2 = {1, 1};
    float d1 = distance1(p1, p2);
    float d2 = distance2(&p1, &p2);
    printf("d1 = %f, d2 = %f\n", d1, d2);
    return 0;
}
